package com.vegetable.modules.vo;

import com.vegetable.modules.entity.stock.CostWeightChangeSource;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 成本单价变化分组展示VO
 * </p>
 *
 * @author wangruijie
 * @since 2024-03-21
 */
@Data
@ApiModel(value="成本单价变化分组展示VO", description="成本单价变化分组展示VO")
public class CostWeightChangeGroupVO {

    @ApiModelProperty(value = "追踪事务ID")
    private String ttid;

    @ApiModelProperty(value = "商品ID")
    private Long commodityId;

    @ApiModelProperty(value = "商品名称")
    private String commodityName;

    @ApiModelProperty(value = "规格ID")
    private Long specsId;

    @ApiModelProperty(value = "规格名称")
    private String specsName;

    @ApiModelProperty(value = "库存批次编码")
    private String stockBatchNo;

    @ApiModelProperty(value = "变化前成本单价")
    private BigDecimal beforeCostWeight;

    @ApiModelProperty(value = "变化后成本单价")
    private BigDecimal afterCostWeight;

    @ApiModelProperty(value = "变化差值")
    private BigDecimal changeAmount;

    @ApiModelProperty(value = "变化幅度百分比")
    private String changePercentage;

    @ApiModelProperty(value = "首次变化时间")
    private Date firstChangeTime;

    @ApiModelProperty(value = "最后变化时间")
    private Date lastChangeTime;

    @ApiModelProperty(value = "变化记录总数")
    private Integer changeCount;

    @ApiModelProperty(value = "操作人姓名列表")
    private List<String> operatorNames;

    @ApiModelProperty(value = "变化类型描述列表")
    private List<String> sourceTypeDescriptions;

    @ApiModelProperty(value = "详细变化记录列表")
    private List<CostWeightChangeSource> detailChanges;
    
    // 添加订单费用变化的详细信息
    @ApiModelProperty(value = "订单费用变化详情列表")
    private List<OrderCostChangeDetail> orderCostChangeDetails;
    
    /**
     * 订单费用变化详情内部类
     */
    @Data
    @ApiModel(value="订单费用变化详情", description="订单费用变化详情信息")
    public static class OrderCostChangeDetail {
        @ApiModelProperty(value = "费用名称")
        private String costName;
        
        @ApiModelProperty(value = "修改前费用")
        private BigDecimal beforeCost;
        
        @ApiModelProperty(value = "修改后费用")
        private BigDecimal afterCost;
        
        @ApiModelProperty(value = "费用差额")
        private BigDecimal costChange;
        
        @ApiModelProperty(value = "变化时间")
        private Date changeTime;
        
        @ApiModelProperty(value = "操作人")
        private String operatorName;
    }
}